package main

import (
	"fmt"
	"net/http"
)

type MyHandler struct{}

//func (h *MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
//	fmt.Fprintf(w, "Hello World! \n")
//}
func main() {
	//	handler := MyHandler{}
	server := http.Server{
		Addr: "127.0.0.1:8080",
		//		Handler: &handler,
	}
	http.HandleFunc("/hello", hello)
	http.HandleFunc("/world", world)
	server.ListenAndServe()
}

func hello(w http.ResponseWriter, r *http.Request) {
	fmt.Fprint(w, "Hello\n")
}

func world(w http.ResponseWriter, r *http.Request) {
	fmt.Fprint(w, "World")
}
